package lormi.meipin.controller.api;


import lormi.meipin.common.Result;
import lormi.meipin.controller.BaseController;
import lormi.meipin.dto.AddComplain;
import lormi.meipin.exception.LMException;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * 投诉管理
 * */
@RestController
@RequestMapping(value="v2/complain/",method=RequestMethod.POST,produces = "application/json; charset=utf-8")
public class ComplainController extends BaseController{
	/**
	 * 添加一个投诉
	 * @Param userid 用户ID
	 * @Param usertype 用户类型
	 * @Param complainid 被投诉人ID
	 * @Param type 投诉类型
	 * @Param content 其他的投诉内容
	 * */
	@RequestMapping("add")
	public String add(@Valid AddComplain addComplain ,BindingResult result) throws LMException{
		checkResult(result);
		
		complainService.addComplain(addComplain);
		
		return Result.success();
	}
	
}
